package com.czy.owner.api;

import com.czy.owner.net.api.BaseApi;
import com.czy.owner.net.listener.HttpOnNextListener;
import com.czy.owner.utils.MyLog;
import com.trello.rxlifecycle.components.support.RxAppCompatActivity;

import java.util.HashMap;

import retrofit2.Retrofit;
import rx.Observable;

/**
 * Created by wangyang on 2017/4/7 0007.
 * 修改用户信息
 */

public class UpdateUserInfoApi extends BaseApi {
    private String session ;
    private String logo ;
    private String nickName ;
    private String sex ;
    private String addr ;
    private String birthday ;

    public UpdateUserInfoApi(HttpOnNextListener listener, RxAppCompatActivity rxAppCompatActivity) {
        super(listener,rxAppCompatActivity);
        setShowProgress(true);
        setCache(false);
    }

    public String getSession() {
        return session;
    }

    public void setSession(String session) {
        this.session = session;
    }

    public String getLogo() {
        return logo;
    }

    public void setLogo(String logo) {
        this.logo = logo;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getAddr() {
        return addr;
    }

    public void setAddr(String addr) {
        this.addr = addr;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    @Override
    public Observable getObservable(Retrofit retrofit) {
        HttpPostService service = retrofit.create(HttpPostService.class);
        HashMap<String,Object> map = new HashMap<>();
        map.put("session", getSession());
        map.put("logo",getLogo());
        map.put("nickName",getNickName());
        map.put("sex",getSex());
        map.put("addr",getAddr());
        map.put("birthday",getBirthday());
        MyLog.e("yang","map=="+map.toString());
        return service.getOwnUpdateApi(map);
    }

}
